package com.example;

import com.example.dao.StudentDao;
import com.example.entity.Student;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Application_04 {
    public static void main(String[] args) {
        // 创建容器
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        // 获取对象
        StudentDao studentDao= (StudentDao) context.getBean("studentDao");
        Student studentById = studentDao.getStudentById(5);
        System.out.println(studentById);
    }
}
